package com.zking.web.zzsf;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.zking.dao.domain.ComUser;
import com.zking.dao.domain.User;
import com.zking.dao.mapper.zzsf.UpdateMapper;

@Controller
public class UpdateController  {
	@Autowired 
	private UpdateMapper upMapper;
	@RequestMapping (value = "/upda")
	public String updateCom(User user,HttpServletRequest request,HttpSession session){
		String roId = "3";
		Object object = session.getAttribute("user");
		user = (User) object;
		user.setRoleid(roId);
		int i = upMapper.updatePay(user);
		if (i!=0) {
			request.getSession().setAttribute("tip", "充值成功");
			return "redirect:/seelp";
		}
		request.getSession().setAttribute("tip", "充值失败");
		return "index";
	}
}
